package job.relevance.anchor_weight;

import java.io.IOException;
import java.util.Iterator;

import mapred.base.TextReducer;

import org.apache.hadoop.io.Text;

public class RLV_AW_Merge_Reducer extends TextReducer {

    @Override
    public void reduce(Text key, Iterator<Text> values) throws IOException {
        StringBuilder sb = new StringBuilder();
        while (values.hasNext()) {
            sb.append(values.next().toString());
        }
        this.output(new Text(key.toString().replaceAll("/\\*\\*\\*/", "\t")),
                new Text(sb.toString()));
    }

    @Override
    public void setUp() {
    }

    @Override
    public void tearDown() throws IOException {
    }

}
